package com.shilan.administrator.qintfm.adapter;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.shilan.administrator.qintfm.R;
import com.shilan.administrator.qintfm.factory.FragmentFactory;

import java.util.ArrayList;

/**
 * Created by dllo on 16/1/12.
 */
public class TablayoutFragmentAdapter extends FragmentPagerAdapter{


    private String[] titles = {"推荐","广播","主播","音乐"};

    public TablayoutFragmentAdapter(FragmentManager fm) {
        super(fm);

    }

    @Override
    public Fragment getItem(int position) {
        //TODO fragment工厂类
        return FragmentFactory.createFragment(position);
    }

    @Override
    public int getCount() {
        return titles.length;

    }

    public  CharSequence getPageTitle(int position){
        return  titles[position];

    }


}
